Web: app-web Learn navigation + Examples list - #165
Merged
Conversation
Phase 5 of the app-web Adwaita rewrite: turn the single-scroll Learn view
into the master→detail structure of app-gnome's `Learn` (`learn.blp`) — an
`AdwNavigationView` with a landing page that pushes to the Tutorial or the
Examples list. This completes the four real views (Learn, Editor, Debugger,
GameConsole).
- `AdwLearnView` (`widgets/learn/learn-view.ts`): rewritten as the navigation
container. A landing page (a boxed list of "Tutorial" / "Examples" rows)
pushes the Tutorial page (the generated `@learn6502/learn` HTML, unchanged)
or the Examples page. Exposes `hasVisibleSubpage` / `navigateBack()` and a
`subpage-changed` event — the web stand-in for the GNOME twin's
`hasVisibleSubpage` property + `navigation.push`/`pop`.
- `ExamplesList` + `ExampleListItem` (`widgets/learn/`): the web twins of
app-gnome's `ExamplesList` / `ExampleListItem`, rendering `@learn6502/examples`.
Each card REUSES the widgets from the earlier phases — the GameConsole
`Display` for the memory-snapshot thumbnail (parsed from the example's
`displayMemory` hex, same as GNOME) and the Editor `SourceView` (read-only,
copyable) for the code. Copy routes through `learnController.dispatch("copy")`
to load the program into the editor.
- Shell: the header back button (stubbed since phase 1) is wired to
`learnView.navigateBack()` and revealed via `updateLearnBackButton()` when a
Learn subpage is open AND the Learn view is on screen (the whole sidebar on
desktop, the active tab on mobile) — matching how the GNOME twin gates it.
- `SourceView` gained a `fillHeight` property (default true for the editor;
false for the example cards, which size to content, capped in CSS).
- app-web now depends on `@learn6502/examples`; adds the `*.asm` text loader +
ambient module declaration (mirroring app-gnome) so example sources import
as strings. No lockfile change (workspace-only dep).
Verified in a headless browser on desktop + mobile: the landing rows render,
pushing Examples shows all three example cards with painted thumbnails and
copyable source, copying an example loads it into the editor (+ toast), the
back button reveals/hides correctly and pops to the landing, and the Tutorial
page renders the full tutorial.
app-web's tsconfig uses an explicit `files` list, not `include`, so an ambient `.d.ts` with no import/export (unreachable via the import closure) is only in the program when listed there. `src/types/asm-module.d.ts` was missing from the list, so the `*.asm` declaration was absent under a clean install and the examples' `import … from "./snake.asm"` failed type-check on CI (TS2307) while passing locally off a stale node_modules where the examples package's own `env.d.ts` happened to be reachable. Register it beside `html-module.d.ts`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 5 of the app-web Adwaita rewrite — turn the single-scroll Learn view into the master→detail structure of app-gnome's
Learn(learn.blp): anAdwNavigationViewwith a landing page that pushes to the Tutorial or the Examples list. This completes the four real views (Learn, Editor, Debugger, GameConsole).What's new
AdwLearnView(widgets/learn/learn-view.ts) — rewritten as the navigation container. A landing page (boxed list of "Tutorial" / "Examples" rows) pushes the Tutorial page (the generated@learn6502/learnHTML, unchanged) or the Examples page. ExposeshasVisibleSubpage/navigateBack()+ asubpage-changedevent — the web stand-in for the GNOME twin'shasVisibleSubpage+navigation.push/pop.ExamplesList+ExampleListItem— web twins of app-gnome's widgets, rendering@learn6502/examples. Each card reuses earlier-phase widgets: the GameConsoleDisplayfor the memory-snapshot thumbnail (parsed fromdisplayMemoryhex, same as GNOME) and the EditorSourceView(read-only, copyable) for the code. Copy routes throughlearnController.dispatch("copy")into the editor.learnView.navigateBack()and revealed viaupdateLearnBackButton()when a Learn subpage is open and the Learn view is on screen (whole sidebar on desktop, active tab on mobile) — matching how the GNOME twin gates it.SourceViewgained afillHeightproperty (defaulttruefor the editor;falsefor example cards, which size to content, capped in CSS).@learn6502/examples; adds the*.asmtext loader + ambient declaration (mirroring app-gnome). No lockfile change (workspace-only dep).Verification
Built with
gjsify build --app browserand driven in a headless browser on desktop + mobile (screenshots captured):A layout fix worth noting: the Learn slot carries the shell's
.shell-view-slotclass (display: block, specificity beats a barelearn-viewrule), so the nav is given an explicitheight: 100%rather than overriding its own flex layout — otherwise theposition: absolute; inset: 0pages collapse to 0 height.gjsify tsc --noEmitclean;gjsify format --checkclean.Remaining: delete-Jekyll + GH-Pages deploy (the hard cutover — to be done with a go-ahead).